import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/platform'
        },
        {
            path: '/',
            component: resolve => require(['../components/common/Home.vue'], resolve),
            meta: { title: '自述文件' },
            children:[
                {
                    path: '/platform/Application',
                    component: resolve => require(['../components/page/Dashboard/Dashboard.vue'], resolve),
                    meta: { title: '物资申请' }
                },
                {
                    path: '/platform/Record',
                    component: resolve => require(['../components/page/Record/RecordTable.vue'], resolve),
                    meta: { title: '申请记录' }
                },
                {
                    path: '/platform/Account',
                    component: resolve => require(['../components/page/Account/Account.vue'], resolve),
                    meta: { title: '账号配置' }
                },
                {
                    path: '/platform/Material',
                    component: resolve => require(['../components/page/MaterialImages/Material.vue'], resolve),
                    meta: { title: '物资图片' }
                },
                {
                    path: '/platform/InforCheck',
                    component: resolve => require(['../components/page/Record/InforCheck.vue'], resolve),
                    meta: { title: '申请记录详情' }
                },
                {
                    path: '/msgList',
                    component: resolve => require(['../components/page/msgList.vue'], resolve),
                    meta: { title: '消息记录' }
                },
            ]
        },
        {
            path: '/login',
            component: resolve => require(['../components/page/Login/Login.vue'], resolve)
        },
        {
            path: '/404',
            component: resolve => require(['../components/page/404.vue'], resolve)
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
})
